package com.jrzh.db.migration.sys;

import com.eroi.migrate.Define;
import com.eroi.migrate.Define.DataTypes;
import com.jrzh.framework.migration.BaseMigration;
import com.jrzh.framework.migration.MigrationHelper;
/**
 * 增加用户事件表
 * @author Mr.Shower
 *
 */
public class Migration_4 extends BaseMigration{
	
	private static final String TABLE_NAME = "sys_user_events";
	
	@Override
	public void down() {
		log.info("##########回滚Sys模块 Migration_4##########");
		MigrationHelper.dropTable(TABLE_NAME);
	}

	@Override
	public void up() {
		log.info("##########执行Sys模块 Migration_4##########Begin");
		table(TABLE_NAME, "系统用户事件表", true,
				pk(),
				column("_user_id", "用户ID", DataTypes.CHAR, Define.length(36)),
				column("_time", "访问时间", DataTypes.TIMESTAMP),
				column("_ip", "访问IP", DataTypes.VARCHAR, Define.length(32)),
				column("_handler_name", "操作名称", DataTypes.LONGVARCHAR, Define.length(512)),
				column("_description", "操作名称", DataTypes.VARCHAR, Define.length(512))
		);
		log.info("##########执行Sys模块 Migration_4##########End");
	}

}
